package com.mdc.mansion.api.web.modules.task;

import com.mdc.mansion.core.modules.push.JPushService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * Created by mingdongc on 2017/4/8.
 */
@Component
public class SystemTask {
    private Logger LOGGER= LoggerFactory.getLogger(SystemTask.class);

    @Resource
    private JPushService jPushService;

    @Scheduled(cron = "0/10 * * * * ?")
    public void tenSenconds (){
        LOGGER.info("==>>10秒钟完美定时任务tenSenconds");
        jPushService.pushMessageToClient();
    }

    @Scheduled(cron = "0 0 1 * * ?")
    public void deleteTask (){
        LOGGER.info("==>>1点钟完美定时任务deleteTask");
        jPushService.deleteLastDaySuccessMessage();
    }
}
